Security and Authentication

Customize Page Security Enforcement

Description
This customization illustrates how to customize the way a page enforces security requirements. An example of this is implementing a non-role-based access requirement.
Variables
Applies to
Page class
Code
 
/// 
/// Authorize method is called during the load phase.
/// 
public override void Authorize(string roles) 
{ 
    // NOTE: if role-based security was configured through Iron Speed Designer,
    // and the page was configured to allow specific roles, those roles will be
    // passed to this function in the roles parameter as a 
    // semi-colon-delimited list of values:  Role1;Role2;etc.
    if (("Your business logic here")) 
    { 
        this.RedirectToForbiddenPage(); 
    } 
    else 
    { 
        base.Authorize(roles); 
    } 
    // Note: If your custom enforcement code must interact with the page's controls (e.g. RecordControls) after 
    // they have had their data loaded from the database, then you can add an event handler for one of 
    // the page's events (e.g. DataBinding, Load, or PreRender) which can conditionally redirect to the 
    // Forbidden page, Sign In page, etc.
}
     

Terms of Service Privacy Statement